-- gd_bonus
-- created by panyl
-- gd功能

return {
    doAction = function(action)
        local gdItem = GDM.getGdItem();
        local no = action.pos;
        local data = action.data;
        local attrib = bit.brshift(data, 16);
        local value = bit.band(data, 0xffff);

        if gdItem["add_attrib"] == no then
            if attrib > 100 then
                attrib = attrib - 100;
                value = - value;
            end

            -- 修改属性
            GDM.add_attrib(FieldsM.getFieldById(attrib), value);
        elseif gdItem["add_item"] == no then
            GDM.add_item(attrib, value);
        elseif gdItem["set_attrib"] == no then
            -- 修改属性
            GDM.set_attrib(FieldsM.getFieldById(attrib), value);
        elseif gdItem["invincible_buff"] == no then
            GDM.invincibleBuff(value);
        else
            assert(false, "尚未支持！");
        end
    end,
};
